<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>客户信息录入</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="__PUBLIC__/css/layui.css"  media="all">
    <link rel="stylesheet" href="__PUBLIC__/css/public.css"  media="all">
</head>
<body>
<div class="layui-conter">
    <div class="layui-col-md12">
        <div class="navigation">
            <span>市场></span><span>客户信息录入</span>
        </div>
        <div class="white-conter selsectSet">
            <div class="title-blue">客户信息录入</div>
            <div style="margin-top: 20px">
                <form class="layui-form" action="{:U('Information/adddata')}" method="post" onsubmit="return check_form();">
                    <input type="hidden" name="scid" value="{$_SESSION.qe_user.id}">
					<input type="hidden" name="xid" value="{$_SESSION.qe_user.xid}">
					<input type="hidden" name="xsid" value="{$_SESSION.qe_user.id}">
					<input type="hidden" name="class_id" value="0">
					<input type="hidden" name="dt_id" value="0">
					<input type="hidden" name="up" value="0">
					<div class="layui-col-md6">
                        <div class="layui-col-md10">
                            <div class="form-item">
                                <div class="label-div">
                                    <label class="form-label">姓名</label>
                                </div>
                                <div class="input-block">
                                    <input type="text" name="name" autocomplete="off" placeholder="请输入..." class="layui-input">
                                </div>
                            </div>
							<div class="form-item">
								<div class="label-div">
									<label class="form-label">英文名</label>
								</div>
								<div class="input-block">
									<input type="text" name="names" autocomplete="off" placeholder="请输入..." class="layui-input">
								</div>
							</div>
                            <div class="form-item" style="overflow: unset" >
                                <div class="label-div">
                                    <label class="form-label">性别</label>
                                </div>
                                <div class="input-block" id="radioContent" style="width: 500px;float: left;">
                                    <input type="radio" lay-filter="select1" name="sex" value="女" title="女" checked="checked">
                                    <input type="radio" lay-filter="select2" name="sex" value="男" title="男">
                                </div>
                            </div>
                            <div class="layui-form-item">
                            	<div class="label-div" style="padding-top: 25px">
                            		<label class="form-label">就读学校</label>
                            	</div>
                            	<div class="layui-input-inline">
                            		<input type="tel" name="school" autocomplete="off" placeholder="请输入..." class="layui-input">
                            	</div>
                            </div>
                            <div class="form-item" style="overflow: unset" >
                                <div class="label-div"  style="padding-top: 25px">
                                    <label class="form-label">渠道来源</label>
                                </div>
                                <div class="input-block" id="radioContent2">
									<foreach name="campus" item="c">
									<if condition="$c['pid'] eq 3">
									<input type="radio" name="am_id" value="{$c.id}" title="{$c.name}">
									</if>
									</foreach>
                                </div>
                            </div>
							<div class="input-block layui-col-md12">
								<div class="layui-form-item">
									<div class="label-div">
										<label class="form-label">出生年月</label>
									</div>
									<div class="layui-input-inline">
										<input type="text" name="birth_date" id="date3" lay-verify="date" placeholder="时间选择" autocomplete="off" class="layui-input">
									</div>
								</div>
							</div>
							<div class="layui-form-item">
								<div class="label-div" style="padding-top: 25px">
									<label class="form-label">手机</label>
								</div>
								<div class="layui-input-inline">
									<input type="tel" name="phone" autocomplete="off" placeholder="请输入..." class="layui-input">
								</div>
							</div>
                        </div>
                    </div>
                    <div class="layui-col-md6">
                        <div class="layui-form-item">
                            <div class="label-div" style="padding-top: 25px">
                                <label class="form-label">备注</label>
                            </div>
                            <div class="layui-input-inline">
                                <input type="text" name="content" autocomplete="off" placeholder="请输入..." class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="label-div" style="padding-top: 25px">
                                <label class="form-label">客户重点情况</label>
                            </div>
                            <div class="layui-input-inline">
                                <select name="akey_id">
                                    <option value="1" >非常重点</option>
                                    <option value="2" >重点</option>
                                    <option value="3" selected="">一般</option>
                                    <option value="4" >未知</option>
                                </select>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="label-div" style="padding-top: 25px">
                                <label class="form-label">状态</label>
                            </div>
                            <div class="layui-input-inline">
                                <select name="state_id">
                                    <option value="0" selected="">请选择</option>
									<foreach name="campus" item="c">
										<if condition="$c['pid'] eq 2">
											<option value="{$c.id}" >{$c.name}</option>
										</if>
									</foreach>
                                </select>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="label-div" style="padding-top: 25px">
                                <label class="form-label">数据采集人:{$_SESSION.qe_user.name}</label>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-md12" style="padding-top: 25px">
                        <div class="button-block">
                            <button class="layui-btn layui-btn-xs layui-btn-normal" lay-submit="" type="submit">提交</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>




<script src="__PUBLIC__/js/layui.all.js" charset="utf-8"></script>
<script src="__PUBLIC__/js/jquery.js"></script>
<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
<script>
    layui.use(['form', 'layedit', 'laydate'], function(){
        var form = layui.form
            ,layer = layui.layer
            , $ = layui.jquery
            ,layedit = layui.layedit
            ,laydate = layui.laydate;
        //日期
        laydate.render({
            elem: '#date'
        });
        laydate.render({
            elem: '#date1'
        });
        laydate.render({
            elem: '#date2'
        });
        laydate.render({
            elem: '#date3'
        });
        form.render()

    });
//js验证表单提交的方法
function check_form() {
	var name = $('input[name="name"]').val();
	if($.trim(name) == '') {
		alert('请输入客户姓名');
		return false;
	}
	var names = $('input[name="names"]').val();
	if($.trim(names) == '') {
		alert('请输入客户英文名称');
		return false;
	}
	var phone = $('input[name="phone"]').val();
	if(!(/^1\d{10}$/.test(phone))) {
		alert('客户手机号格式不正确');
		return false;
	}
	var obj2=document.getElementsByName("am_id");
    for(var i=0;i<obj2.length;i++){
         if(obj2[i].checked==true){
             temp=1;
             break;
         }else{
             temp=0;
        }
    }
    if(temp==0){alert("请选择渠道来源");return false;}
}
</script>
</body>
</html>
